import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
import { createRouter } from "./router";
import store from "./store";

import Vant from 'vant'
import 'vant/lib/index.css';

import axios from "axios";
import VueAxios from "vue-axios";

//设置后端接口的统一前缀

axios.defaults.baseURL = 'http://localhost:8080/api/'
// axios请求拦截 让每次请求都携带令牌
axios.interceptors.request.use(
    config => {
        config.headers['financed-token'] = store.state.token;
        return config;
    },
    error => {
        return Promise.reject(error);
    }
);

createApp(App).use(createRouter()).use(Vant).use(store).mount('#app')